package com.monitor.controller;


import com.monitor.dto.AdminDTO;
import com.monitor.dto.AdminPageDTO;
import com.monitor.modelExt.AdminExt;
import com.monitor.pubInter.IBaseService;
import com.monitor.pubInter.exception.SkException;
import com.monitor.searchExt.AdminSearchExt;
import com.monitor.vo.AdminDetailDomainVO;
import com.monitor.vo.AdminDetailVO;
import com.monitor.vo.AdminDomainVO;
import com.monitor.vo.AdminListVO;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Enumeration;

@RequestMapping("/ykSync/")
@RestController(value = "yunKeSyncController")
@Slf4j
public class YunKeSyncController extends ApiManageController<AdminDTO, AdminPageDTO, AdminExt, AdminSearchExt, AdminDomainVO, AdminDetailDomainVO, AdminDetailVO, AdminListVO,String>{

    @Override
    public IBaseService<AdminExt, AdminSearchExt, String> getBaseService() throws SkException {
        return null;
    }


    //    客户信息同步
    @RequestMapping("customerSync")
    public String customerSync(HttpServletRequest request) {
        // 获取所有参数名
        Enumeration<String> parameterNames = request.getParameterNames();

        // 遍历参数名并获取对应的值
        while (parameterNames.hasMoreElements()) {
            String paramName = parameterNames.nextElement();
            String paramValue = request.getParameter(paramName);
            log.info(paramName+"===="+paramValue);
        }
        return "callback";
    }

//    通话记录同步
    @RequestMapping("callSync")
    public String callSync(HttpServletRequest request) {
        // 获取所有参数名
        Enumeration<String> parameterNames = request.getParameterNames();

        // 遍历参数名并获取对应的值
        while (parameterNames.hasMoreElements()) {
            String paramName = parameterNames.nextElement();
            String paramValue = request.getParameter(paramName);
            log.info(paramName+"===="+paramValue);
        }
        return "callback";
    }
}
